package cn.lccabc.attend.dao;

import cn.lccabc.attend.entity.Attend;
import cn.lccabc.attend.vo.QueryCondition;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AttendMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Attend record);

    int insertSelective(Attend record);

    Attend selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Attend record);

    int updateByPrimaryKey(Attend record);

    /**
     * 查询当天是否有打卡记录
     * @param user_id
     * @return
     */
    Attend selectTodaySignRecord(@Param("userId") Long user_id);

    /**
     * 考勤数据分页查询符合条件的行数
     * @param condition
     * @return
     */
    int countByCondition(QueryCondition condition);

    /**
     * 考勤数据分页查询
     * @param condition
     * @return
     */
    List<Attend> selectAttendPage(QueryCondition condition);

    /**
     * 查找今天没有打卡的用户
     * @return
     */
    List<Long> selectTodayAbsence();

    /**
     * 批量插入没有打卡的用户
     * @param attends
     */
    void batchInsert(List<Attend> attends);
}